﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Adm.Master" Theme="Adm" AutoEventWireup="true" CodeBehind="FormProfissionais.aspx.cs" Inherits="PROAD.admin.Forms.FormProfissionais" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="IncludeHead" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="IncludeTitulo" runat="server">
<h1>Formulário Profissional de Saúde</h1>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="IncludeLink" runat="server">
<h1><a href="/admin/Consulta/ConsultaProfissionais.aspx">Lista de Profissionais de Saúde - Nova</a></h1>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="IncludeConteudo" runat="server">
<h2>Preencha os dados abaixo</h2>
    
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    
    <asp:HiddenField ID="hdfCodProf" runat="server" />
    <asp:HiddenField ID="hdfCodCat" runat="server" />
    <table width="100%">
        <tr>
            <td colspan="2">
                Nome do Profissional *</td>
            <td colspan="1">
                Matrícula *</td>
        </tr>
         <tr>
            <td colspan="2">
                <asp:TextBox ID="txtNome" runat="server" Width="500px"></asp:TextBox>
            </td>
            <td colspan="1">
            <asp:TextBox ID="txtCpf" runat="server" Width="205px" MaxLength="14"></asp:TextBox>
           
            </td>
        </tr>
         <tr>
            <td>
                Categoria Profissional *</td>
            <td >
                E-mail *</td>
            <td>
            Telefone
            </td>
        </tr>
         <tr>
            <td>
                <asp:DropDownList ID="ddlCategoria" runat="server" Width="179px" DataValueField="CO_CATEGORIA_PROF" DataTextField="NO_CATEGORIA">
                </asp:DropDownList>
            </td>
            <td>
            <asp:TextBox ID="txtEmail" runat="server" Width="235px"></asp:TextBox>
            </td>
            <td>
            <asp:TextBox ID="txtTelefone" runat="server" Width="130px"></asp:TextBox>
            <asp:MaskedEditExtender ID="MasktxtTelefone" TargetControlID="txtTelefone" MaskType="Number" ClearMaskOnLostFocus="false" Mask="(99) 9999-9999" runat="server">
            </asp:MaskedEditExtender>
            </td>
        </tr>
    </table>
    <table width="100%" >
        <tr>
            <td>Micro Área (ACS)</td>
            <td>Senha de Acesso*</td>
            <td>Perfil de Acesso*</td>
            <td>Status*</td>
        </tr>
        <tr>
            <td><asp:TextBox ID="txtMicroArea" runat="server"></asp:TextBox></td>
            <td><asp:TextBox ID="txtSenha" TextMode="Password" runat="server"></asp:TextBox></td>
            <td>
                <asp:DropDownList ID="ddlPerfil" runat="server" Width="148px">
                    <asp:ListItem Value="">Perfil</asp:ListItem>
                    <asp:ListItem Value="1">Administrador</asp:ListItem>
                    <asp:ListItem Value="0">Profissional</asp:ListItem>                    
                </asp:DropDownList>
            </td>
            <td>  
                <asp:DropDownList ID="ddlStatus" runat="server" Width="148px">
                    <asp:ListItem Value="">Status</asp:ListItem>
                    <asp:ListItem Value="1">Ativo</asp:ListItem>
                    <asp:ListItem Value="0">Inativo</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td colspan="4">Registro Profissional</td>
        </tr>
        <tr>
            <td colspan="4"><asp:TextBox ID="txtRegProfissional" runat="server"></asp:TextBox></td>
        </tr>
        <tr>
            <td colspan="4">&nbsp;</td>
        </tr>
        <tr>
            <td colspan="4">
            <div style=" margin-left:580px">
                       <asp:Button ID="btnCancelar" runat="server" Text="Cancelar" />&nbsp;&nbsp;
                       <asp:Button ID="btnEditar" runat="server" Text="Salvar" 
                           onclick="btnEditar_Click" />
                       <asp:Button ID="btnSalvar" runat="server" Text="Salvar" 
                           onclick="btnSalvar_Click" />
                       </div>
            </td>
        </tr>
    </table>

    <asp:Panel ID="PanelEquipe" runat="server">
        <h2>Equipes do profissional</h2>
        
        <table width="100%">
            <tr>
                <td align="right">
                    <asp:LinkButton ID="linkNovoEs" runat="server" onclick="linkNovoEs_Click">Nova Equipe</asp:LinkButton>
                </td>
            </tr>
        </table>

        <%--Grid com resultados--%>
        <asp:GridView ID="gridEs" runat="server" CellPadding="4" ForeColor="#333333" 
            GridLines="None" SkinID="GridAdm" AutoGenerateColumns="false" 
            EmptyDataText="<center>Não foram encontrados registros!</center>" 
            onrowcommand="gridEs_RowCommand">
                      
            <Columns>
            <asp:TemplateField HeaderText="">
                <ItemTemplate>
                    <asp:LinkButton ID="lnkStatus" runat="server" CommandName="Status"
                        CommandArgument='<%#Eval("CO_ES")%>' Visible="True">
                        <img alt="Status" border="0" src="../../common/imagem_sis/imagem_sis/<%#Eval("NR_STATUS").ToString() == "0" ? "inativo.png" : "ativo.png"%>" />
                    </asp:LinkButton>
                </ItemTemplate>
                <HeaderStyle Font-Size="13px" Width="40px" Font-Names="Verdana"/>
                <ItemStyle Font-Size="10pt" HorizontalAlign="Center" />
            </asp:TemplateField> 
                
            <asp:BoundField DataField="NO_ES" HeaderText="Nome ES">
                <HeaderStyle Font-Size="13px" Font-Names="Verdana" HorizontalAlign="Left"/>
                <ItemStyle Font-Size="10pt" HorizontalAlign="Left" />
            </asp:BoundField>

            <asp:BoundField DataField="DS_AREA" HeaderText="Área">
                <HeaderStyle Font-Size="13px" Font-Names="Verdana" HorizontalAlign="Left"/>
                <ItemStyle Font-Size="10pt" HorizontalAlign="Left" />
            </asp:BoundField>
                        
            <asp:BoundField DataField="NO_US" HeaderText="Nome US">
                <HeaderStyle Font-Size="13px" Font-Names="Verdana" HorizontalAlign="Left"/>
                <ItemStyle Font-Size="10pt" HorizontalAlign="Left" />
            </asp:BoundField>

            <asp:BoundField DataField="NO_SIGLA" HeaderText="UF">
                <HeaderStyle Font-Size="13px" Font-Names="Verdana" HorizontalAlign="Left"/>
                <ItemStyle Font-Size="10pt" HorizontalAlign="Left" />
            </asp:BoundField>

            <asp:TemplateField HeaderText="">
                <ItemTemplate>
                    <asp:LinkButton ID="lnkExcluir" runat="server" CommandName="Excluir"
                        CommandArgument='<%#Eval("CO_ES")%>' Visible="True">
                        <img alt="Excluir" border="0" src="../../common/imagem_sis/imagem_sis/excluir.png" />
                    </asp:LinkButton>
                </ItemTemplate>
                <HeaderStyle Font-Size="13px" Width="40px" Font-Names="Verdana"/>
                <ItemStyle Font-Size="10pt" HorizontalAlign="Center" />
            </asp:TemplateField>
                                              
            </Columns>
                                            
        </asp:GridView>
    </asp:Panel>

    <!-- Área de Validação abaixo -->

    <div style="display:none;">
    <asp:HyperLink ID="linkMsn" runat="server">HyperLink</asp:HyperLink>
    </div>

    <asp:ModalPopupExtender ID="ModalPopupMsn" TargetControlID="linkMsn" runat="server"
        PopupControlID="PainelMsn" CancelControlID="btnCancelarMsn"
        BackgroundCssClass="modalBackground">
    </asp:ModalPopupExtender>

    <asp:Panel ID="PainelMsn" runat="server" Style="display:none" Width="350px" CssClass="modalPopup">
        <asp:Panel ID="PainelCabecalho" runat="server" Style="border-bottom:solid 1px Gray;height:25px;">
            <div>
                <h1 style="line-height:25px;text-align:center;margin:0px 0px 0px 0px;vertical-align:bottom;padding:0px 0px 0px 0px;font-size:14px;font-family:Verdana;background-color:#FFFF95;">
                    <asp:Label ID="txtTituloMsn" runat="server"></asp:Label>
                    
                </h1>
            </div>
        </asp:Panel>
        <div>
            <br />
            <h2 style="margin:0px 0px 0px 0px;font-family:Verdana;font-size:11px;font-weight:normal;line-height:25px;width:100%;text-align:center;">
                <asp:Label ID="txtTextoMsn" runat="server"></asp:Label>
            </h2>
            <br />
            <table width="100%">
                <tr>
                    <td align="center">
                        <asp:Button ID="btnCancelarMsn" runat="server" Text="OK" />
                    </td>
                </tr>
            </table>            
        </div>
    </asp:Panel>

    <!-- Final Área de Validação -->

    <!-- Modal Incluir Equipe abaixo -->
    
    <div style="display:none;">
        <asp:HyperLink ID="linkEquipe" runat="server">Nova Equipe</asp:HyperLink>
    </div>
        
    <asp:ModalPopupExtender ID="ModalEquipe" TargetControlID="linkEquipe" runat="server"
        PopupControlID="PainelModEquipe" CancelControlID="btnCancelarEquipe"
        BackgroundCssClass="modalBackground">
    </asp:ModalPopupExtender>

    <asp:Panel ID="PainelModEquipe" runat="server" Style="display:none" Width="500px" CssClass="modalPopup">
        <asp:Panel ID="Panel2" runat="server" Style="border-bottom:solid 1px Gray;height:25px;">
            <div>
                <h1 style="line-height:25px;text-align:center;margin:0px 0px 0px 0px;vertical-align:bottom;padding:0px 0px 0px 0px;font-size:14px;font-family:Verdana;background-color:#FFFF95;">
                    Incluir Equipe                 
                </h1>
            </div>
        </asp:Panel>
        <div>
            <br />
                <table width="100%">
                    <tr>
                        <td>
                            UF
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:DropDownList ID="ddlUf" runat="server" Width="130px" DataValueField="CO_UF" AutoPostBack="true" 
                                DataTextField="NO_SIGLA" onselectedindexchanged="ddlUf_SelectedIndexChanged">
                            </asp:DropDownList>
                        </td>
                    </tr>

                    <tr>
                        <td>
                            US
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:DropDownList ID="ddlUS" runat="server" Width="115px" 
                                DataValueField="CO_US" DataTextField="NO_US" AutoPostBack="true" 
                                onselectedindexchanged="ddlUS_SelectedIndexChanged">
                            </asp:DropDownList>
                        </td>
                    </tr>

                    <tr>
                        <td>
                            ES
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:DropDownList ID="ddlEs" runat="server" Width="115px" DataValueField="CO_ES" DataTextField="NO_ES">
                            </asp:DropDownList>
                            <asp:Label ID="lblMsnErroEquipe" runat="server" ForeColor="Red"></asp:Label>
                        </td>
                    </tr>
                </table>
            <br />
            <table width="100%">
                <tr>
                    <td align="center">
                        <asp:Button ID="btnCancelarEquipe" runat="server" Text="Cancelar" />
                        <asp:Button ID="btnIncluirEquipe" runat="server" Text="Incluir" 
                            onclick="btnIncluirEquipe_Click" />
                    </td>
                </tr>
            </table>            
        </div>
    </asp:Panel>

    <!-- Final Área de Validação -->

    </ContentTemplate>
    </asp:UpdatePanel>
    

</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="IncludeRodape" runat="server">
</asp:Content>
